<template>
  <div class="">
    <el-form :model="detailForm" class="elForm">

      <el-card class="box-card" shadow="never">
        <div slot="header" class="header-card">
          <span class="header-card-title">车辆信息</span>
        </div>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车架号:">
              <span>{{ detailForm.vinNo }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="发动机号码:">
              <span>{{ detailForm.engineNo }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记日期:">
              <span>{{ detailForm.issuanceDate }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆种类:">
              <span>{{ detailForm.vehicleCategory }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆类型:">
              {{ selectDictLabel(dict.type.car_type, detailForm.carType) }}
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆性质:">
              <span>
                {{ selectDictLabel(dict.type.car_nature, detailForm.carNature) }}
              </span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆品牌:">
              <span>{{ detailForm.brandName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车系:">
              <span>{{ detailForm.seriesName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆运营:">
              <span>{{ detailForm.operationsName }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车型:">
              <span>{{ detailForm.modelName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="档位:">
              <span>{{ detailForm.gearPosition }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆大区:">
              <span v-if="detailForm.region">{{ detailForm.region }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="座位数:">
              <span>{{ detailForm.seatNum }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="燃油类型:">
              <span>{{ selectDictLabel(dict.type.fuel_type, detailForm.fuelType) }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="排量:">
              <span>{{ detailForm.liter }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="环保标准:">
              <span>{{ detailForm.environmentalStandards }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="外观颜色:">
              <span>{{ detailForm.exteriorColor }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="内饰颜色:">
              <span>{{ detailForm.interiorColor }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆级别:">
              <span>{{ detailForm.carLevel }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆随车物品:">
              <span>{{ detailForm.carAccompanying }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="备用钥匙数量:">
              <span>{{ detailForm.spareKeyNum }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆状态:">
              <span>
                {{ selectDictLabel(dict.type.car_business_type, detailForm.businessType) }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="进口车/国产车:">
              <span v-if="detailForm.domesticImported == 1">国产车</span>
              <span v-if="detailForm.domesticImported == 2">进口车</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆产权:">
              <span>{{ detailForm.propertyRightName }}</span>
            </el-form-item>
          </el-col>


        </el-row>

        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="车辆归属:">
              <span>{{ detailForm.ascription }} </span>
            </el-form-item>
          </el-col>


        </el-row>

        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="上传合格证:">
              <image-common v-model="detailForm.qualifiedCardOss" :disabled="true" :upType="2"/>
            </el-form-item>
          </el-col>
        </el-row>

      </el-card>

      <el-card class="box-card" shadow="never">
        <div slot="header" class="header-card">
          <span class="header-card-title">车辆采购信息</span>
        </div>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="采购禀议号:">
              <span>{{ detailForm.purchaseNo }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="指导价:">
              <span>{{ format_thousand(detailForm.guidancePrice )}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="采购单价:">
              <span>{{ format_thousand(detailForm.purchasePrice) }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="供应商名称:">
              <span>{{ detailForm.supplierName }}</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="box-card" shadow="never">
        <div slot="header" class="header-card">
          <span class="header-card-title">车辆折旧信息</span>
        </div>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="已行驶公里数:">
              <span>{{ detailForm.mileageStr }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆原币原值:">
              <span>{{ format_thousand(detailForm.carOriginalCurrency) }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="月折旧费:">
              <span>{{ format_thousand(detailForm.carMonthlyPremium) }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="已折旧月数:">
              <span>{{ detailForm.carMonthlyPremiumCount }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="累计折旧:">
              <span>{{ detailForm.carTotalPremium }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆净值:">
              <span>{{ format_thousand(detailForm.carNetValue) }}</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

    </el-form>
  </div>
</template>

<script>
export default {
  name: "index",
  dicts: ["car_business_type", "car_type", "car_nature", "fuel_type"],
  props: {
    value: {
      type: Object,
      default: {},
    },
  },
  computed: {
    selectDictLabel() {
      return function (arr, val) {
        return arr
            .map((a) => {
              if (a.value == val) {
                return a.label;
              }
            })
            .filter((a) => a)[0];
      };
    },
  },
  watch: {
    value: {
      handler(newValue) {
        if (newValue) {
          this.detailForm = newValue;
        }
      },
      immediate: true,
      deep: true,
    },
  },
  data() {
    return {
      detailForm: {},
    };
  },
  created() {
  },
  mounted() {
  },
  methods: {},
};
</script>

<style scoped lang="scss">
@import "@/styles/cwgd/formScss.scss";
</style>


